<template>
    <div>
        名字：{{stu.name}}, {{stu.salary}}, {{age}}
        <p>
            <button @click="double">double</button>
        </p>
    </div>
</template>
<script>
import { reactive, ref } from 'vue'
export default {
    setup () {

        const stu = ref(
            {
                name:'小花',
                salary: 12000 
            }
        )
        const double = () => {
            // reactive定义的数据，不要.value
            stu.value.salary *= 2
        }
        const age = ref(18)

        // const stu = reactive(
        //     {
        //         name:'小花',
        //         salary: 12000 
        //     }
        // )
        // const double = () => {
        //     // reactive定义的数据，不要.value
        //     stu.salary *= 2
        // }

        return { stu, double, age }
    }
}
</script>